//------------Sonic CD Bullet Script-------------//
//--------Scripted by Christian Whitehead 'The Taxman'--------//
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//

//-------Aliases-------//
#alias 39: TYPE_BULLET


sub ObjectMain
	Object.Value2+=8192
	Object.XPos+=Object.Value1
	Object.YPos+=Object.Value2
	if Object.OutOfBounds==1
		Object.Type=TypeName[BlankObject]
	else
		TempValue0=Screen.YOffset
		TempValue0-=8
		TempValue0<<=16
		if Object.YPos<TempValue0
			Object.Type=TypeName[BlankObject]
		endif
	endif
endsub


sub ObjectPlayerInteraction
	PlayerObjectCollision(C_TOUCH,-4,-4,4,4)
	if CheckResult==1
		CallFunction(PlayerObject_Hit)
	endif
endsub


sub ObjectDraw
	DrawSprite(Object.Frame)
	Object.Value0++
	if Object.Value0>2
		Object.Value0=0
		Object.Frame++
		Object.Frame&=3
	endif
endsub


sub ObjectStartup
	LoadSpriteSheet("R1/Objects.gif")
	SpriteFrame(-4,-4,8,8,166,34)
	SpriteFrame(-4,-4,8,8,175,34)
	SpriteFrame(-6,-6,12,12,101,93)
	SpriteFrame(-6,-6,12,12,114,93)
endsub

sub RSDK
	LoadSpriteSheet("Global/Display.gif")
	SetEditorIcon(Icon0,SingleIcon,-16,-16,32,32,1,143)
endsub
